for a in range(0,31):
    for b in range(0,23):
        if a + b == 30 and a * 2 + b * 4 == 90:
            print("鸡有", a, "只，兔有", b, "只")

